<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

<center><font size="6" style="font-weight: bold;font-family: Verdana;text-shadow: 2px 2px 2px gray;">받은 쪽지함</font></center>
<c:choose>
	<c:when test="${requestScope.message.messageList!=null}">
	<table border="1" style="table-layout:fixed;" width="700"  class="TableMessage">
			<tr>
				<td width="100">보낸사람</td><td width="200">내용</td><td width="150">날짜</td><td width="50">삭제</td>
			</tr>
	<c:forEach items="${requestScope.message.messageList}" var="message">
		<tr>
			<td><input type="hidden" value="${message.no }" id="hiddenNo">${message.sendVO.id }</td>
			<td><a href="member_getMessageInfo.do?no=${message.no }"><div style="text-overflow: ellipsis; white-space: nowrap; overflow: hidden;"><nobr>${message.content }</nobr></div></a></td>
			<td>${message.writeDate }</td>
			<td><input type="button" value="삭제" id="getMessageBtn" class="send"></td>
		</tr>
	</c:forEach>
	</table>
	<center>
	<ul>
	<c:set var="pb" value="${requestScope.message.pb}"></c:set>
	<c:if test="${pb.previousPageGroup}">
		<li><a href="member_getmessage.do?pageNo=${pb.startPageOfPageGroup-1 }">
		◀</a></li>
	</c:if>
	 <c:forEach var="i" begin="${pb.startPageOfPageGroup }"  end="${pb.endPageOfPageGroup }">
	 <c:choose>
	 	<c:when test="${pb.nowPage!=i }">
	 	<li><a href="member_getmessage.do?pageNo=${i }">${i }</a></li>
	 	</c:when>
	 	<c:otherwise>
	 		 <li><a>${i}</a></li>
	 	</c:otherwise>
	 </c:choose>
	 </c:forEach>
	 <c:if test="${pb.nextPageGroup }">
		  <li><a href="member_getmessage.do?pageNo=${pb.endPageOfPageGroup+1}">▶</a></li>
	</c:if>
	</ul>
	</center>
	</c:when>
	<c:otherwise>
		<table border="1" style="table-layout:fixed" width="700"  class="TableMessage">
			<tr>
				<td width="100">보낸사람</td><td width="200">내용</td><td width="150">날짜</td><td width="50">삭제</td>
			</tr>
			<tr>
				<td colspan="4"> <font size="3">받은 쪽지가 없습니다.</font></td>
			</tr>
		</table>
	</c:otherwise>
</c:choose>
